<?php echo $header; ?>


		  <!-- Start - Left Side -->
	      <div id="left" class="span-24">
		      <div id="webboard" class="span-24 checkout">
		      	<div class="heading_x span-24">
					<span><?php echo $heading_title; ?></span><hr />
				</div>
		      	  <div>
  <?php  if($webboard_guest == "1" || $register_user != null || $admin !=null) { ?>

<span style="float:right;margin-right:5px;margin-bottom:5px;color:purple;cursor:pointer;font-weight:bold">
	<div class="galib_btn2 float_right">
        <a onclick="location='<?php  echo 'index.php?route=webboard/new_post'; ?>'"  ><?php  echo $text_newpost; ?></a>
    </div>
</span>
   <?php  } else { ?>
<span style="float:right;margin-right:5px;margin-bottom:5px;color:purple;cursor:pointer;font-weight:bold;text-transform:uppercase">
	<div class="galib_btn2 float_right">
       <a onclick="location='<?php  echo 'index.php?route=account/login'; ?>'" ><?php  echo $text_newpost_alert; ?></a>
    </div>
	</span>
<?php  } ?>
 <table border="0" width="100%" id="table1">
	<tr class="tb_head">
		<th bgcolor="#F0ECE1" class="tb_center" ><?php  echo $text_order?></th>
		<th bgcolor="#F0ECE1" class="tb_center"><?php  echo $text_title_board?></th>
		<th bgcolor="#F0ECE1" class="tb_center"><?php  echo $text_read?></th>
		<th bgcolor="#F0ECE1" class="tb_center"><?php  echo $text_reply?></th>
		<th bgcolor="#F0ECE1" class="tb_center"><?php  echo $text_author?></th>
	</tr>

<?php 
    $i=0;
   foreach ($ask as $ask_post) {
     if ($i%2==1) {$chk=' bgcolor="#f9f9f9" ';}else{$chk='';}
     if (iconv_strlen($ask_post['title'],"utf-8") > 40) {$ask=iconv_substr($ask_post['title'],0,20,"utf-8")."...";}else{$ask=$ask_post['title'];}
?>
	<tr class="tb_body">
		<td class="tb_center" align="center" <?php  echo $chk?>>
		<?php  if 	($admin !=null) { ?>
		<a href="index.php?route=webboard/board&act=delete&id=<?php  echo $ask_post['ask_id'];?>&page=<?php  echo $page?>"  onClick="return Conf(this)" >
		   <img src="catalog/view/theme/default/image/b_drop.png" alt="delete"  border="0" />
		</a>
		<?php  } ?>
		<?php  echo $ask_post['ask_id'];?>
		<?php  if 	($admin !=null) { ?>
   		<a href="index.php?route=webboard/edit&id=<?php  echo $ask_post['ask_id'];?>&page=<?php  echo $page?>">
		   <img src="catalog/view/theme/default/image/b_edit.png" alt="edit"  border="0" />
		 </a>
		<?php  } ?>
		</td>
		<td <?php  echo $chk?>>
		<a href="index.php?route=webboard/read_board&id=<?php  echo $ask_post['ask_id']?>" title="<?php  echo $ask_post['title']?>"><?php  echo $ask;?></a>
		<?php  if ($ask_post['new'] <= $webboard_day) {?>
		  <img src="catalog/view/theme/default/image/new.gif" alt="new" />
		<?php  } ?>
		</td>
		<td class="tb_center" <?php  echo $chk?>><?php  echo number_format($ask_post['counter']);?></td>
		<td class="tb_center" <?php  echo $chk?>>
		<?php  if ($ask_post['new_reply'] <= $webboard_day) {?>
		  <img src="catalog/view/theme/default/image/new.gif" alt="new" />
		<?php  } ?>	
		<?php  echo number_format($ask_post['number_reply']);?>
		</td>
		<td class="tb_center" <?php  echo $chk?>><?php  echo $ask_post['author'];?></td>
	</tr>
<?php   
$i++;
} 
?>

</table>
    
      
        <div class="pagination"><?php  echo $pagination; ?></div>
      
      </div>
		      </div>
	      </div>
       	 <!-- End - Left Side -->
       	 
       	 


<?php echo $footer; ?> 
<script Language="Javascript">
<!--
function Conf(Object) {
	if (confirm("<?php  echo $alert?>") == true){
		return true;
	}
	    return false;
	}
//-->
</script>
